/* 1_Butt.rexx V1.3 11/95 -- Butt one pair of audio clips together. */
/* >>> modified by Aussie 1995 <<<
designed to work on Flyer versions, 4.1+
To use, highlight the second of two AUDIO clips (placed together in a row, then run this ARexx routine. The second AUDIO clip will be set to immediately start after the first clip ends. (Great for butting music & narration bits back together.)
*/
call remlib('PROJECT_REXX_PORT')
call addlib('PROJECT_REXX_PORT',0)
/* --- begin --- */
OK=1
NotOK=0
AudioNext=NotOK
AudioPrev=NotOK
start_loc=croutonspot()
if start_loc>0 then do
/* --- Check previous audio clip --- */
call croutonpick(start_loc-1)
if croutontype()=" AUD" then AudioPrev=OK
/* --- Check next audio clip --- */
call croutonpick(start_loc)
if croutontype()=" AUD" then AudioNext=OK
end
/* --- wait for any screen update delay --- */
call time('R')
do while (time('E')<0.5)
end
call req_open("One Butt (V 1.2) - by Aussie","-----------------------","Butts one SELECTED audio clip","to the end of the PREVIOUS audio clip.")
/* --- Kick out if both are not audio clips --- */
if AudioNext~=OK then do
call req_tell("<<< Sorry, CANCELED! >>>"," The selected clip must be"," an AUDIO ONLY crouton!")
call req_close()
call quit1
end
if AudioPrev~=OK then do
call req_tell("Sorry, CANCELED!"," The previous clip MUST ALSO"," be an audio crouton!")
call req_close()
call quit1
end
test = req_tell("Ok to butt this together"," with the last audio clip?")
call req_close()
if test~=OK then call quit()
/* ------------- butt them here */
call croutonpick(start_loc-1)
prevstart=croutongettag(Delay)
Last_Time_Mode= croutongettag(TimeMode) /* Lock to 2=prog time 1=inpoint 0=clip */
nextstart=prevstart+croutongettag(AudioDuration)
/* --- set following audio clip start points --- */
call croutonpick(start_loc)
call croutonsettag(Delay,NextStart)
call croutonsettag(TimeMode,Last_Time_Mode) /* Locking to 2=prog time 1=inpoint 0=clip */
/* --- Wrap Up --- */
call projectupdate()
call croutonpick(start_loc)
call req_error(" OZ: Butt is All Done. Operation was successful ")
call remlib("PROJECT_REXX_PORT")
exit
quit:
call req_error(" OZ: Operation was << Canceled >>"," ")